package com.chexiehui.jc.mvp.mine;

import com.chexiehui.jc.Constants;
import com.chexiehui.jc.base.BaseModel;
import com.chexiehui.jc.base.BasePage;
import com.chexiehui.jc.base.BaseView;
import com.chexiehui.jc.entity.PostInfo;

import io.reactivex.Observable;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;

/**
 * @Description 我发布的帖子
 * @Auth SongJun
 * @Date 2019/11/20 10:05
 **/
public interface MySendPostsCovenant {

    interface View extends BaseView {
        void onGetListSuccess(BaseModel<BasePage<PostInfo>> successResult);

        void onGetListFailure(BaseModel<Object> failureResult);

        void onDoDianZanSuccess(BaseModel<String> successResult);

        void onDoDianZanFailure(BaseModel<Object> failureResult);

        void onDoFollowPersonSuccess(BaseModel<String> successResult);

        void onDoFollowPersonFailure(BaseModel<Object> failureResult);

        void onDoDeletePostSuccess(BaseModel<String> successResult);

        void onDoDeletePostFailure(BaseModel<Object> failureResult);

    }

    interface Stores {
        @FormUrlEncoded
        @POST(Constants.URL_GET_USER_POSTS)
        Observable<BaseModel<BasePage<PostInfo>>> getList(
                @Field("pageIndex") int pageIndex, @Field("pageSize") int pageSize);

        @FormUrlEncoded
        @POST(Constants.URL_POST_DIAN_ZAN)
        Observable<BaseModel<String>> doDianZan(
                @Field("orgid") String orgid,
                @Field("type") String type
        );

        @FormUrlEncoded
        @POST(Constants.URL_ADD_FOLLOW)
        Observable<BaseModel<String>> doFollowPerson(
                @Field("orgid") String orgid,
                @Field("type") String type
        );
        @FormUrlEncoded
        @POST(Constants.URL_DELETE_POST)
        Observable<BaseModel<String>> doDeletePost(
                @Field("Id") String Id
        );
    }

    interface Presenter {
        void getList(int pageNum);

        void doDianZan(String objId);

        void doFollowPerson(String objId);

        void doDeletePost(String objId);
    }

}